package cn.njxzc.examples;

import java.util.ArrayList;
import java.util.Iterator;

public class Exam8_7 {

	@SuppressWarnings({ "unchecked", "rawtypes" })
	public static void main(String[] args) {
		ArrayList list = new ArrayList();
		list.add(1000);
		list.add(new Byte((byte) 1));
		list.add(new Short((short) 2));
		list.add(new Integer(3));
		list.add(new Long(60));
		list.add(new Float(5.0F));
		list.add(new Double(60.00));
		System.out.println(list);// output list
		Iterator i = list.iterator();
		System.out.println("================");
		while (i.hasNext())
			System.out.println(i.next());
		// second method
		int len = list.size();
		System.out.println("================");
		for (int n = 0; n < len; n++)
			System.out.println(list.get(n));
	}

}
